<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>酒店 机票查询</title>
<link href="../css/soso/normal.css" type="text/css" rel="stylesheet"></link>
<link href="../css/soso/style.css" type="text/css" rel="stylesheet"></link>
<link href="../css/soso/top.css" type="text/css" rel="stylesheet"></link>
<link href="../css/soso/city_menu.css" type="text/css" rel="stylesheet"></link>
<script src="../js/jquery-1.9.1.min.js" type="text/javascript"></script>
</head>
<body>
<div class="soso"><!--=S search-->
  <div class="s_h">
 <span style="width:70px">酒店查询</span> 
 <span style="width:70px">机票查询</span> 
  </div>
  <ul class="s_c">
    <form id="form_hotel" name="form_hotel" method="post" action="search?tp=ts">
    <input name="cityid" id="cityid" value="1" type="hidden"/>
    <li class="input_wrap">
    <label for="txtCity">目的城市:<s class="icon_city"></s></label>
    <input name="txtCity" id="txtCity" onclick="suggestH.display(this,'',event);" autocomplete="off" value="北京" onchange="SetCity(this)" type="text"/>
    </li>
    <li class="input_wrap">
    <label for="tm1">入住日期:<s class="icon_date"></s></label>
    <input onclick="javascript:event.cancelBubble=true;showCalendar('tm1',false,'tm1','tm2','tm2',''+ZNDate.format(ZNDate.today())+'',''+ZNDate.format(ZNDate.plus(ZNDate.today(),60))+'','','','','SWeek','')" onblur="javascript:this.value=this.value.replace(/[^\d\-]/g,'');" id="tm1" value="2013-03-29" name="tm1" readonly="readonly" type="text"/>
    </li>
    <li class="input_wrap">
    <label for="tm2">离店日期:<s class="icon_date"></s></label>
    <input onclick="javascript:SelHotelCalMethod(event,'out','tm1','tm2',''+ZNDate.format(ZNDate.plus(ZNDate.today(),60))+'');" onblur="javascript:this.value=this.value.replace(/[^\d\-]/g,'');" id="tm2" value="2013-04-01" name="tm2" readonly="readonly" type="text"/>
    </li>
    <li class="input_wrap">
    <label for="input_price">价格范围:<s class="icon_city"></s></label>
    <input name="input_price" class="sinput" id="input_price" value="不限" type="text"/>
    <input name="minprice" class="sinput" id="minprice" value="200" type="hidden"/>
    <input name="maxprice" class="sinput1" id="maxprice" value="300" type="hidden"/>
      <div id="div_price" style="position: absolute; left: 294.5px; top: 425px; width: 132px; display: none;">
       <ul id="ul_price">
        <li class="">不限</li>
        <li class="">100元以下</li>
        <li class="">100-200元</li>
        <li class="">200-300元</li>
        <li class="">300元以上</li>
       </ul>
      </div>
    </li>
    <li class="input_wrap">
    <label for="gjz">关键字:</label>
    <input id="gjz" name="key" value="酒店名/景点等" type="text"/>
    </li>
    <li class="input_btn">
    <input class="soso_btn" value="" onclick="toSearch();" type="button"/>
    <input value="1" name="flagecx" type="hidden" />
    </li>
  </form> 
  </ul>
</div>
<script type="text/javascript">
//价格范围控件以及关键字控件控制函数： add by Huangwensong
$(document).ready(function(){
   $("#div_price").css({position:'absolute',left:$("#input_price").offset().left,top:$("#input_price").offset().top +22,width:$("#input_price").width() +12});
  $("#input_price").click(function(){
    $("#div_price").show();
	  $(this).val("");
  });
	$("#ul_price li").hover(function(){
		$(this).addClass("li_css");
	},function(){
		$(this).removeClass("li_css");
	});
	$("#ul_price li").click(function(){
	    $("#input_price").val($(this).text());
		if($(this).text()=="不限")
		{ $("#minprice").val("0");$("#maxprice").val("0");}
		if($(this).text()=="100元以下")
		{ $("#minprice").val("0");$("#maxprice").val("100");}
		if($(this).text()=="100-200元")
		{ $("#minprice").val("100");$("#maxprice").val("200");}
		if($(this).text()=="200-300元")
		{ $("#minprice").val("200");$("#maxprice").val("300");}
		if($(this).text()=="300元以上")
		{ $("#minprice").val("300");$("#maxprice").val("10000");}
	});
	$("#input_price").blur(function(){
	    if ($("#input_price").val().length ==0){
		    $("#input_price").val("不限");
		}
	    setTimeout('$("#div_price").hide()',500);
	});
});
	//--&gt;
var gjzval = "";
$(document).ready(function(){
      $("#scrollDiv").Scroll({line:2,speed:1000,timer:3000});
      gjzval = $("#gjz").val();
      $("#gjz").focus(function(){
    	  $(this).val("");
      });
});
function toSearch(){
	if(!checkindex()){
		return;
	}
	if($("#gjz").val() == gjzval)$("#gjz").val("");
	$("#form_hotel").submit();
	
}
function checkindex(){
	var f = document.form_hotel;
	if(!f.cityid.value||!f.txtCity.value)
	{
	alert("请选择城市！");
	OnClickCompatible('txtCity');return false;
	}
	if(!f.tm1.value)
	{
	alert("请输入入住日期！");
	OnClickCompatible('tm1');return false;
	}
	if(!f.tm2.value)
	{
	alert("请输入离店日期 ！");
	OnClickCompatible('tm2');return false;
	}
	if(!f.minprice.value)f.minprice.value=0;
	if(!f.maxprice.value)f.maxprice.value=0;
	if(isNaN(f.minprice.value)||isNaN(f.maxprice.value))
	{
	alert("房价范围必须为数字!");
	f.minprice.focus();return false;
	}
	if((f.minprice.value*1>=f.maxprice.value*1)&&f.maxprice.value!='0')
	{
	alert("最低价不能高于最高价！");f.minprice.focus();return false;
	}
	if(ZNDate.parse(f.tm1.value)>=ZNDate.parse(f.tm2.value)){
	alert("请输入的日期不合法！");
	OnClickCompatible('tm1');return false;
	}
	//$(this).loading({div:"#mainContent"});
	//return false;
	} 
function OnClickCompatible(id){
	$("#"+id).click();
}
//滚动插件
(function($){
$.fn.extend({
      Scroll:function(opt,callback){
              //参数初始化

              if(!opt) var opt={};
              var _this=this.eq(0).find("div:first");
              var        lineH=_this.find("dl:first").height() + 3, //获取行高
                      line=opt.line?parseInt(opt.line,10):parseInt(this.height()/lineH,10), //每次滚动的行数，默认为一屏，即父容器高度
                      speed=opt.speed?parseInt(opt.speed,10):500, //卷动速度，数值越大，速度越慢（毫秒）
                      timer=opt.timer?parseInt(opt.timer,10):3000; //滚动的时间间隔（毫秒）

              if(line==0) line=1;
              var upHeight=0-line*lineH;
              //滚动函数
              scrollUp=function(){
                      _this.animate({
                              marginTop:upHeight
                      },speed,function(){
                              for(var i=1;i<=line;i++){
                                      _this.find("dl:first").appendTo(_this);
                              }
                              _this.css({marginTop:0});
                      });
              }
              //鼠标事件绑定
              _this.hover(function(){
                      clearInterval(timerID);
              },function(){
                      timerID=setInterval("scrollUp()",timer);
              }).mouseout();
      }        
})
})(jQuery);

$(function(){
if(!$("#tm1").val())$("#tm1").val(ZNDate.format(ZNDate.plus(ZNDate.today(),1)));
if(!$("#tm2").val())$("#tm2").val(ZNDate.format(ZNDate.plus(ZNDate.today(),2)));
$("#index_com .ib_con dl dd,#index_ask .ib_con dl dd").each(function(){$(this).simpletooltip({br:true});});
setkeya();

});
function rollchain(val){
	var box=$(".info_box.rollchain");
	box.find(".box_tit ul").each(function(){$(this).find("li").eq(''+val+'').attr("id","bt_current").siblings().removeAttr("id");});
	box.find(".pp_list ul").eq(''+val+'').show().siblings().hide();
}
function loadcs(id,cityname,a){//v1(obj);
if(($(".tab-nav ul li#bt_current span").html()==cityname) && (!a))return;
$(".tab-nav ul li").each(function(){
if(cityname==$(this).find("span").html()){$(this).attr("class","cur")}else{$(this).removeAttr("class");}});
$.ajax({url : "index.php?m=ajkeyword.tuijian",type : 'POST',data: ({cid:id,cname:escape(cityname)}),dataType: "html",beforeSend : function(data){$(this).loading({div:"#ajaxbox",mini:true})},success : function(data){$(".loading").each(function(){$(this).remove()});$("#ajaxboxinfo").html(unescape(data));},timeout:5000,error: function () {$(".loading").each(function(){$(this).remove()});$("&lt;div style=\"-moz-border-radius:3px 3px 3px 3px;color:red;background-color:#FFDDDD;border:1px solid #CCCCCC;margin:0.8em 0 1.2em;padding:5px;text-align:center;\"&gt;对不起，请求超时，请您&lt;a href=\"javascript:void(0);\" onClick=\"return loadcs("+id+",'"+cityname+"',1);\"&gt;重新查询！&lt;/a&gt;&lt;/div&gt;").insertBefore(".tuijian_con")}});
}
function loadWord(aid,c){
	if(c){	$(':input#cityid').val(aid);	$(':input#txtCity').val(c);setColor('#txtCity',3,'#CDEDF8',160);}	
	$('#key').val('');
	$.ajax({url : "index.php?m=ajkeyword&amp;id="+aid,type : 'get',dataType: "html",beforeSend : function(data){$(this).loading({div:"#search",mini:true});},success : function(data){$("#search").css({position:""});$(".loading").each(function(){$(this).remove()});$("#search2").html(data);setkeya();},timeout: 5000,error: function(){$("#search").css({position:""});$(".loading").each(function(){$(this).remove()});$("#search2").html("&lt;div style=\"-moz-border-radius:3px 3px 3px 3px;color:red;background-color:#FFDDDD;border:1px solid #CCCCCC;margin:0.8em 0 1.2em;padding:5px;\"&gt;对不起，请求超时，请您&lt;a href=\"javascript:void(0);\" onClick=\"return loadWord("+aid+",'"+c+"');\"&gt;重新查询！&lt;/a&gt;&lt;/div&gt;")}
	});	
};
function setkeya(){$("#search2 ul li a").each(function(){$(this).click(function(e){setColor('#key',3,'#CDEDF8',160);$("#key").val($(this).html());e.preventDefault(); });});}
</script>
<script src="../js/soso/citys.js" type="text/javascript"></script>
<script src="../js/soso/city_menu.js" type="text/javascript"></script>
<script src="../js/soso/date.js" type="text/javascript"></script>
<script src="../js/soso/calendar.js" type="text/javascript"></script>
</body>
</html>